package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.SaleMakedDetailMapper;
import com.ly.heart.domain.SaleMakedDetailEntity;
import javax.annotation.Resource;
import com.ly.heart.service.ISaleMakedDetailService;

/**
 * 销售价目详情Service业务层处理
 * 
 * @author wutao
 * @date 2024-07-15
 */
@Service
public class SaleMakedDetailServiceImpl extends ServiceImpl<SaleMakedDetailMapper, SaleMakedDetailEntity> implements ISaleMakedDetailService {

    @Resource
    private SaleMakedDetailMapper saleMakedDetailMapper;

    /**
     * 查询销售价目详情
     * 
     * @param id 销售价目详情ID
     * @return 销售价目详情
     */
    @Override
    public SaleMakedDetailEntity selectSaleMakedDetailById(String id)
    {
        return saleMakedDetailMapper.selectSaleMakedDetailById(id);
    }

    /**
     * 查询销售价目详情列表
     * 
     * @param saleMakedDetail 销售价目详情
     * @return 销售价目详情
     */
    @Override
    public List<SaleMakedDetailEntity> selectSaleMakedDetailList(SaleMakedDetailEntity saleMakedDetail)
    {
        return saleMakedDetailMapper.selectSaleMakedDetailList(saleMakedDetail);
    }

    /**
     * 新增销售价目详情
     * 
     * @param saleMakedDetail 销售价目详情
     * @return 结果
     */
    @Override
    public int insertSaleMakedDetail(SaleMakedDetailEntity saleMakedDetail)
    {
        saleMakedDetail.setCreateTime(DateUtils.getNowDate());
        return saleMakedDetailMapper.insertSaleMakedDetail(saleMakedDetail);
    }

    /**
     * 修改销售价目详情
     * 
     * @param saleMakedDetail 销售价目详情
     * @return 结果
     */
    @Override
    public int updateSaleMakedDetail(SaleMakedDetailEntity saleMakedDetail)
    {
        saleMakedDetail.setUpdateTime(DateUtils.getNowDate());
        return saleMakedDetailMapper.updateSaleMakedDetail(saleMakedDetail);
    }

    /**
     * 批量删除销售价目详情
     * 
     * @param ids 需要删除的销售价目详情ID
     * @return 结果
     */
    @Override
    public int deleteSaleMakedDetailByIds(String[] ids)
    {
        return saleMakedDetailMapper.deleteSaleMakedDetailByIds(ids);
    }

    /**
     * 删除销售价目详情信息
     * 
     * @param id 销售价目详情ID
     * @return 结果
     */
    @Override
    public int deleteSaleMakedDetailById(String id)
    {
        return saleMakedDetailMapper.deleteSaleMakedDetailById(id);
    }
}
